package com.daiyang.seckill.common.exception;

import com.daiyang.seckill.common.error.ErrorCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class ControllerException extends RuntimeException{
    /**
     * @see com.daiyang.seckill.common.error.ControllerErrorCodeConstants
     * @param errorCode
     */
    private Integer code;
    private String msg;

    public ControllerException() {

    }
    public ControllerException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }


    public ControllerException(ErrorCode errorCode) {
        this.code = errorCode.getCode();
        this.msg = errorCode.getMsg();
    }
}
